/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.member;

import com.enation.app.javashop.client.member.ShopCatClient;
import com.enation.app.javashop.core.client.fallback.member.ShopCatClientFallbackFactory;
import com.enation.app.javashop.core.handler.FeignConfiguration;
import com.enation.app.javashop.model.shop.dos.ShopCatDO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @version v7.0
 * @Description: 店铺分组Client默认实现
 * @Author: zjp
 * @Date: 2018/7/25 16:46
 */
@FeignClient(name = "member-service",fallbackFactory = ShopCatClientFallbackFactory.class,configuration = {FeignConfiguration.class})
public interface ShopCatClientFeignImpl extends ShopCatClient {
    /**
     * 获取当前分组所有的子(包括当前分组)
     * @param catPath
     * @return 子类集合
     */
    @Override
    @RequestMapping(value = "/client/shops/cat",method = RequestMethod.GET)
    List getChildren(@RequestParam("cat_path") String catPath);

    /**
     * 获取店铺分组
     * @param id 店铺分组主键
     * @return ShopCatDO  店铺分组
     */
    @Override
    @RequestMapping(value = "/client/shops/cat/{cat_id}",method = RequestMethod.GET)
    ShopCatDO getModel(@PathVariable("cat_id") Long id);

}
